#include<iostream>
using namespace std;

int isBD(int ch) 
{
	if(ch=='?'||ch=='!'||ch=='.'||ch==','||ch==' ')
 		return 1;
	return 0;
}

void AntiChange(char *s)
{
 	int i=0;
 	while(s[i]!='\0')
 	{
 		while(s[i]!='\0'&&isBD(s[i]))
 		{
 			cout<<s[i];
 			i++; 
 		}
 		int m=i;
 		while(s[i]!='\0'&&!isBD(s[i]))
 		{
 		 i++;
 		}
 		int n=i-1;
 		for(int j=n;j>=m;j--)
 		{
 			cout<<s[j];
 		}
 	}
}

int main()
{
	char s[100]="I like c++";
 	AntiChange(s);
 	return 0;
}
